package com.hl.mapper;

import com.hl.pojo.Certificate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CertificateMapper {
    @Insert("insert into  certificate (certificate_url, consultant_id) VALUE (#{certificateUrl},#{consultantId})")
    Integer add(Certificate certificate);
    @Update("update certificate set del = 1 where id = #{id}")
    Integer del(Certificate certificate);
    @Select("select * from certificate where id = #{id} and del !=1")
    List<Certificate> findById(Certificate certificate);
    @Select("select * from certificate where consultant_id = #{consultantId} and del !=1")
    List<Certificate> findByConsultant(Certificate certificate);
}
